package com.maisonliberte.updater;

import com.maisonliberte.dao.Dao;
import com.maisonliberte.entity.TableInfo;

public abstract class AbstractUpdater {

	protected String url;
	protected String uid;
	protected String weight;
	protected TableInfo tInfo;
	public AbstractUpdater(String _url, String _uid, String _weight){
		this.url = _url;
		this.uid = _uid;
		this.weight = _weight;
		this.tInfo = new TableInfo();
		tInfo.setUid(_uid);
		tInfo.setWeight(Integer.valueOf(_weight));
		tInfo.setQty(10);
	}
	
	public void process(){
		setDetailInfo();
		update();
	}
	
	private void update(){
		Dao.getInstance().update(this.tInfo);
	}
	
	abstract protected void setDetailInfo();

}
